class Solution:
    def countCompleteDayPairs(self, hours: List[int]) -> int:
        mod = 24
        ans = 0
        cnt = defaultdict(int)
        for h in hours:
            ans += cnt[(mod - h % mod) % mod]
            cnt[h % mod] += 1
        return ans
